package com.lingyun.mqttserver.vo;

import lombok.Getter;

@Getter
public enum ErrorCode {
    PARAMS_ERROR(10001,"参数有误"),
    ACCOUNT_PWD_NOT_EXIST(10002,"用户名或密码不存在"),
    TOKEN_ERROR(10003,"token不合法"),
    NO_PERMISSION(70001,"无访问权限不足"),
    SESSION_TIME_OUT(90001,"会话超时"),
    NO_LOGIN(90002,"未登录"),
    EXISTING_PHONE(10004,"已有手机号"),
    UPDATE_ERROR(10005,"更新失败"),
    DELETE_ERROR(10006,"删除失败"),
    INSERT_ERROR(10007, "插入失败"),
    TOKEN_DELETE_ERROR(10010, "token删除失败"),
    DATABASE_INSERT_ERROR(10011, "数据库插入错误"),
    DATABASE_INSERT_NULL(10012, "数据库插入失败"),
    PHONE_VERIFY_ERROR(10013, "手机号码格式不正确"),
    VERIFY_NULL(10014,"验证码不能为null"),
    VERIFY_ERROR(10015,"验证码错误"),
    PASSWORD_LENGTH_ERROR(10016,"密码长度必须在 6 到 20 个字符之间"),
    NICKNAME_NULL(10017,"昵称不能为null"),
    CLIENT_CREATE_ERROR(10018, "client创建错误"),
    CLIENT_SEND_ERROR(10019,"信息发送错误"),
    SELECT_ERROR(10020, "查询失败"),
    SELECT_PHONE_ERROR(10021, "没有此手机号"),
    ACCOUNT_EXIST(10022, "账号已存在"),
    REDIS_ERROR(10023, "redis错误"),
    HARDWARE_OFFLINE(10024, "设备不在线"),
    SOURCE_NULL(10025,"传输数据不能为null"),
    HARDWARE_NULL(10026, "未找到此硬件id"),
    VIRTUAL_NULL(10027,"数据id不能为null"),
    SLEEP_NULL(10028, "sleep错误"),
    HARDWARE_DATABASE_NULL(10029,"数据库没有此设备"),
    NUMBER_RANGE(10030, "超过数值范围"),
    SHARE_ERROR(10031, "不能给自己分享"),
    REGISTER_ERROR(10032, "注册失败"),
    HARDWARE_PHONE_NOTNULL(10033, "设备已被注册"),
    HARDWARE_DELETE_ERROR(10034, "还未拥有该设备"),
    NAME_NULL(10035, "name不能为null"),
    ADDRESS_NULL(10036, "没有此地址"),
    ADDRESS_RANGE(10037, "地址超出范围"),
    NULL_ERROR(10038, "数据为null"),
    DATASOURCE_NO_LOGIN(10039,"设备未登录"),
    LOG_CREATE_ERROR(10040,"日志设置创建失败" ),
    SHARE_NOT_ERROR(10041,"分享设备不可更改设置"),
    PAY_ERROR(10042, "支付下单失败"),
    TYPE_ERROR(10043, "类型错误"),
    SINGLENESS_ERROR(10044,"像单片机发送数据错误"),
    EXCEL_ERROR(10045,"必填字段不可为空"),
    LOGIN_ERROR(10046, "登录失败"),
    SUBSCRIPTION_ERROR(10047, "订阅失败"),
    MKDIR_ERROR(10048, "文件夹创建失败"),
    WXLOG_ERROR(10049, "HTTP错误"),
    PHONE_GET_ERROR(10050, "手机号获取失败"),
    GROUP_NULL(10052, "分组不为空"),
    INDEX_NULL(10053, "没有此属地"),
    LOGSETTING_NULL(10054, "没有设置此日志"),
    PRINT_ERROR(10055, "打印失败"),
    PASSWORD_ERROR(10056, "密码错误"),
    LOGIN_SESSION_TIME(10057, "登录过期");

    private int code;
    private String msg;

    ErrorCode(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
